<?php

session_start();
include_once( 'include.php' );

header('Content-Type:text/html; charset=utf-8');

$o = new SaeTOAuth( WB_AKEY , WB_SKEY  );

$port = '';

//echo $_SERVER['SERVER_PORT'];

if( $_SERVER['SERVER_PORT'] != 80 ) $port = ':'.$_SERVER['SERVER_PORT'];
$proto= /* is_https()?'https://': */ 'http://';
$keys = $o->getRequestToken();
$aurl = $o->getAuthorizeURL( $keys['oauth_token'] , true , $proto .$_SERVER['HTTP_HOST'] . '/callback.php');

$_SESSION['keys'] = $keys;


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>抓水粉</title>
<script type="text/javascript"
	src="https://www.google.com/jsapi?key=ABQIAAAAntXBEGiwbYdat-p7iJ8GfxQGS-V4MFiIQ9qSEZNhoa924T4tfxRMuBfy_VvgV-cUtS1a7_Rc8eGo8Q"></script>

<script type="text/javascript">
google.load("jquery", "1.5.1");
google.load("jqueryui", "1.8.10");
</script>
</head>
<body>



<button
	class="ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all"><a
	class="ui-button-text" href="<?php echo $aurl; ?>">使用新浪微博登录</a></button>


</body>
</html>
